package com.ccl.iot.publics;

import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.ScrollView;

import com.ccl.iot.R;
import com.ccl.iot.views.CustomPopupWindow;
import com.ccl.iot.views.ModifyStyleItemView;

public class ModifyStylePop extends CustomPopupWindow {

//	private Context mContext;

	private View view;

	private Button mModify, mCancel;

	private ScrollView mSlv;

	private ModifyStyleItemView mItems;

	public ModifyStylePop(Context mContext) {
		super(mContext);
		view = View.inflate(mContext, R.layout.popupwindwo_modify_style, null);
		mModify = (Button) view.findViewById(R.id.pop_modify_style_btn_ok);
		mCancel = (Button) view.findViewById(R.id.pop_modify_style_btn_cancel);
		mSlv = (ScrollView) view.findViewById(R.id.pop_slv);
		mItems = new ModifyStyleItemView(mContext);
		mSlv.addView(mItems);
		
		// 设置视图
		this.setContentView(this.view);

		// 设置弹出窗体显示时的动画，从底部向上弹出
		this.setAnimationStyle(R.style.take_photo_anim);
	}
	
	public void setOnCheckedChangeListener(OnCheckedChangeListener listener){
		if(mItems != null){
			mItems.setOnIconItemChangeListener(listener);
		}
	}
	
	public void setOnCliclListener(View.OnClickListener okListener, View.OnClickListener cancelListener){
		if(okListener != null && mModify != null){
			mModify.setOnClickListener(okListener);
		}
		
		if(cancelListener != null && mCancel != null){
			mCancel.setOnClickListener(cancelListener);
		}
	}
}
